package com.example.arcgisdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
import com.esri.arcgisruntime.data.ServiceFeatureTable;
import com.esri.arcgisruntime.layers.FeatureLayer;
import com.esri.arcgisruntime.mapping.ArcGISScene;
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.BasemapStyle;
import com.esri.arcgisruntime.mapping.view.Camera;
import com.esri.arcgisruntime.mapping.view.SceneView;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        ArcGISRuntimeEnvironment.setApiKey("AAPK16f373c3c78b4649a69e3a835c5d3882R5BVdgvKpdtCoQiyCZ2tmmmDBdceVK9Gz2duNf4Fy1Q4Uo-LUbfAvSR6NuKBOr2I");
        SceneView sceneView=findViewById(R.id.sceneView);
        ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);
        sceneView.setScene(scene);
        ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(
                "http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer");
        scene.getBaseSurface().getElevationSources().add(elevationSource);
        //[DocRef: END]

        // add a camera and initial camera position
        Camera camera = new Camera(28.4, 83.9, 10010.0, 10.0, 80.0, 0.0);
        sceneView.setViewpointCamera(camera);
    }


}